package main;

import java.util.LinkedList;
import java.util.List;

/**
 * Created by twer on 3/4/14.
 */
public class PrimeFactorExercises {
    public List<Integer> generate(int N){
        System.out.println("Prime Factors:");
        List<Integer> factors = new LinkedList<Integer>();
        int d = 2;
        while (N>1){
            while(N%d == 0){
                factors.add(d);
                N /= d;
                System.out.print(d + " ");
            }
            d++;
        }
        return factors;
    }
}
